<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="func" uri="http://www.zz.com/tag" %>
<%@ taglib prefix="ui" tagdir="/WEB-INF/tags" %>
<form id="attach">
    <input type="hidden" name="applicationIdZ" value="${attach.applicationIdZ}">

    <div class="span3">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody>
            <tr>
                <td class="titleCss100">
                    附件类型
                </td>
                <td class="tdCss">
                    <ui:tsingletableautocomplete
                            keyFieldName="annextype"
                            valueFieldName="annextypeXXXX"
                            tableName="DICT_ITEM"
                            key="ITEM_KEY"
                            value="ITEM_VALUE"
                            groupId="entBackupAttachTypeInsp"
                            defaultKey="${attach.annextype}"
                            defaultValue=""/>
                </td>
            </tr>
            </tbody>
        </table>
    </div>

    <div class="span4">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody>
            <tr>
                <td class="titleCss100">
                    文件名
                </td>
                <td class="tdCss">
                    <input type="hidden" name="fileId" id="fileId"
                           value="${attach.fileId}">
                    <input type="text" name="annexname" id="annexname" readonly="readonly"
                           value="${attach.annexname}">
                </td>
                <td class="tdCss">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tbody id="filetable">
                        <tr>
                        </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="span12">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tbody>
            <tr>
                <td class="titleCss100">
                    备注
                </td>
                <td class="tdCss">
                    <textarea rows="3" class="span12" name="remark">${attach.remark}</textarea>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</form>

<script type="text/javascript">
    $(function () {
        zzupload("filetable", function (data) {
            $("#attachEditDiv #fileId").val(data.fileId);
            $("#attachEditDiv #annexname").val(data.fileName);
        }, true);

        formValidate("attach", {
            annextype : {minlength:1, maxlength:20},
            annexname : {minlength:1, maxlength:100},
            remark : {maxlength:2000}
        }, true);
    });
</script>

